<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function getcolor(){
				var r=Math.floor(Math.random()*256);
				var g=Math.floor(Math.random()*256);
				var b=Math.floor(Math.random()*256);
				return "rgb("+r+","+g+","+b+")";
			}
		</script>
		<button type="button" onclick="fun()">随机色</button>
		<script type="text/javascript">
			function fun(){
				document.body.setAttribute("style",
				"background-color: "+getcolor()+";");
			}
		</script>
	</body>
</html>
